<script setup>
import NavigationBar from '@/components/NavigationBar.vue'

const socket = new WebSocket("ws://localhost:8931/ws");
socket.onopen = function () {
  console.log("WebSocket 连接已打开");
  // socket.send("Hello Server!");
  socket.send(JSON.stringify({ userId: "123455", auth: "123456", sdg: "sdgasd", })); // 发送认证消息
};
socket.onmessage = function (event) {
  console.log("收到服务器消息: " + event.data);
};
socket.onclose = function () {
  console.log("WebSocket 连接已关闭");
};

</script>

<template>
  <el-container>
    <el-header direction-="vertical">
      <NavigationBar />
    </el-header>
    <el-main>
      <div class="container">
        <router-view></router-view>
      </div>
    </el-main>

  </el-container>
</template>
